package ace.module.oauth2.server.core.impl.manager;

import ace.cmp.data.spring.data.jdbc.querydsl.rsql.core.manager.DtoManager;
import ace.module.oauth2.server.api.model.dto.Oauth2AuthorizationDto;
import ace.module.oauth2.server.core.impl.dao.entity.Oauth2Authorization;

/**
* 客户端认证的令牌 spring data jdbc querydsl rsql manager.
*
* @author Caspar
*/
public interface Oauth2AuthorizationManager extends DtoManager<Oauth2Authorization, String, Oauth2AuthorizationDto> {

  String save(Oauth2Authorization authorization);

  Oauth2Authorization getByRefreshTokenValue(String token);

  Oauth2Authorization getByAccessTokenValue(String token);

  Oauth2Authorization getByAuthorizationCodeValue(String token);

  Oauth2Authorization getByState(String token);

  Oauth2Authorization getByToken(String token);

  Oauth2Authorization getFromCacheByIdAndDeleteFlagIsFalse(String id);

  Oauth2Authorization getFromCacheById(String id);
}
